<template>
  <div>
    <h1>弹框</h1>
    <hr>
    <el-button @click="f1" type="success">点我弹框-简单-警告框</el-button>
    <el-button @click="f2" type="success">点我弹框-简单-确认框</el-button>
  </div>
</template>

<script>
  export default {
    methods:{
      f1(){
        this.$alert('接下来的擦做很重要，请小心！', '警告', {
          confirmButtonText: '确定',
          callback: action => {
            this.$message({
              type: 'info',
              message: `action: ${ action }`
            });
          }
        });
      },
      f2(){
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>